
#ifndef __DKACTOR_H__
#define __DKACTOR_H__

#include "cocos2d.h"
#include "DKEvent.h"
#include "DKPoint.h"
#include "EnumType.h"
#include "DKAction.h"

USING_NS_CC;


#define dka(actorType, initXIndex, initYIndex) DKActor::create((DKActorType)actorType, initXIndex, initYIndex)

class DKActor : public cocos2d::CCSprite
{
private:

public:
	DKActor();
	virtual ~DKActor();
	static DKActor *create(enum DKActorType actorType, int initXIndex, int initYIndex);
	static const int ACTOR_SIZE = 40;

	DKPoint location;
	int zIndex;
	float movingVelocity;
	bool isMoving;
	enum DKActorType actorType;

	cocos2d::CCString *actorName;
	cocos2d::CCString *imagePath;

	static CCPoint getScreenPoint(DKPoint indexPoint);
	static DKPoint getIndexPoint(CCPoint screenPoint);
	bool moveToPositionScreen(CCPoint screenPosition);
	bool moveToDKPoint(DKPoint screenPoint);
	bool moveAsDirection(DKEventDirection direction);
	void onMoveFinished(CCNode* sender);

	DKAction * BePushed(DKEvent *evt, CCObject *map);
};

#endif